home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / hack / 3_1 / sys / msdos / install.dos < prev    next >
Encoding:
Text File  |  1993-01-14  |  17.8 KB  |  355 lines

  1.     SCCS Id: @(#)Install.dos     3.1        93/01/06
  2.  
  3.         Copyright (c) NetHack PC Development Team 1990 - 1993.
  4.         NetHack may be freely redistributed.  See license for details.
  5.         ======================================================
  6.             Instructions for compiling and installing
  7.                  NetHack 3.1 on an MS-DOS system
  8.         ======================================================
  9.                  (or, How to make PC NetHack 3.1)
  10.                     Last revision: Jan 6, 1993
  11.  
  12. Credit for a runnable full PC NetHack 3.1 goes to the PC Development team
  13. of Norm Meluch, Kevin Smolkowski, Paul Winner and Steve VanDevender who
  14. built on the work of Pierre Martineau, Stephen Spackman, Steve Creps,
  15. Mike Threepoint and Don Kneller.
  16.  
  17. I.  Dispelling the Myths:
  18.  
  19.     Compiling NetHack is not as easy as it sounds, nor as hard as it looks,
  20.     however it will behoove you to read this entire file through before
  21.     beginning the task.
  22.  
  23.     We have provided the proper makefiles for building NetHack using the
  24.     following compilers:
  25.  
  26.     Microsoft C 6.0a
  27.     Microsoft C 7.0
  28.     DJGPP       1.9   (gcc version 2.2 for msdos,
  29.                        free from your local archive sites)
  30.  
  31.     For specific details concerning each compiler, please see the
  32.     corresponding appendix.
  33.  
  34.     All the makefiles were created for use with NDMAKE.  The make programs
  35.     provided by the various vendors all seem to lack necessary features.
  36.     NDMAKE is available free from your local archive site.
  37.  
  38.     You may find it useful to obtain copies of lex (flex) and yacc (bison).
  39.     While not strictly necessary to compile nethack, they are required should
  40.     you desire to make any changes to the level and dungeon compilers.
  41.     Flex and Bison are included with the DJGPP distribution and are also
  42.     available on many archive sites.
  43.  
  44. II. To compile your copy of NetHack on a MSDOS machine:
  45.     (or "just follow these few 'simple' steps outlined below.")
  46.  
  47. 1.  It almost goes without saying that you should make sure that your tools
  48.     are set up and running correctly.
  49.  
  50. 2.  Make sure all the NetHack files are in the appropriate directory
  51.     structure.  You should have a main directory with subdirectories
  52.     dat, doc, include, src, sys\share, sys\msdos, util and win\tty.
  53.     Other subdirectories may also be included in your distribution, but
  54.     they are not necessary for use with MSDOS.  You can delete them
  55.     to save space.  If you are using MSC7, the makefile will create
  56.     an additional directory src\o.
  57.  
  58.     Check the file "Files" in your top level directory for an exact
  59.     listing of what file is in which directory.  In order for the
  60.     Makefiles to work, all the source files must be in the proper
  61.     locations.
  62.  
  63.     If you downloaded or ftp'd the sources from a UNIX system, the lines
  64.     will probably end in UNIX-style newlines, instead of the carriage
  65.     return and line feed pairs used by DOS.  Some programs have trouble
  66.     with them, so you may need to convert them (with a utility like
  67.     Rahul Dhesi's "flip").  Also, every file should end with an empty
  68.     line, because both Microsoft C and MASM have a habit of ignoring the
  69.     last line of each file. 
  70.  
  71. 3.  The file termcap.uu is the fixed version of the Fred Fish termcap library.
  72.     You will need to run a uudecode utility on it to generate the file
  73.     termcap.zip.  termcap.zip contains several files of termcap routines.
  74.     Using them with NetHack involves very little knowledge of the UNIX concept
  75.     of a termcap database; mostly you need to know enough to set a TERM
  76.     environment variable.  You can unzip termcap.zip in the sys/msdos
  77.     directory, but if you are going to use it, it is probably better to
  78.     unzip a copy in a special directory and copy the library files to where
  79.     your linker can find them.
  80.  
  81.     Makefiles are included should you want to build your own termcap
  82.     library file.  Makemsc.lib works with Microsoft C and generates
  83.     termcap.lib, Makegcc.lib works with DJGPP and generates libtermc.a.
  84.  
  85. 4.  ovlmgr.uu (MS-DOS overlay manager) is the uuencoded assembled
  86.     object module for the overlay manager used with Microsoft C 6.0
  87.     and older.  This file is provided in case you do not have an assembler
  88.     of your own.  You will need to run a uudecode utility on this file too,
  89.     to generate ovlmgr.obj.  If you want to use this, put the ovlmgr.obj
  90.     in the src directory; the makefile will access it when it needs it.
  91.  
  92. 5.  Go to the sys/msdos directory and run the setup.bat batch file
  93.     with either MSC or GCC as the argument.  The necessary Makefile
  94.     movements will be accomplished for you.  In addition, when used
  95.     with the MSC option, certain compiler options will be set.  Make
  96.     sure that you either run setup.bat each time you start compiling
  97.     or copy the line that starts "SET CL" into your autoexec.bat file.
  98.  
  99. 6.  Now go to the include subdirectory to check a couple of the header
  100.     files there.  Things *should* work as they are, but since you have
  101.     probably set up your system in some sort of custom configuration
  102.     it doesn't hurt to check out the following:
  103.  
  104.     First check config.h according to the comments to match your system and
  105.     desired set of features.  Mostly you need to check the WIZARD option,
  106.     make sure the HACKDIR is set properly, and check TERMLIB and COMPRESS.
  107.  
  108.     We've managed to enable all the special features.  You may include all
  109.     or as few of them as you wish.
  110.  
  111.     Also check pcconf.h, which should not need much editing (if you are
  112.     including termcap.uu and random.c).  If you are not including these, you
  113.     will need to comment out TERMLIB and/or RANDOM.  If you are using
  114.     a Microsoft compiler you should make doubly certain that OVERLAY is
  115.     defined in pcconf.h, since otherwise things will compile properly but
  116.     very ugly things are likely to happen wherever function pointers
  117.     cross overlay boundaries - the linker is a little thick about that.
  118.  
  119.     Commenting out the #define TERMLIB in pcconf.h to disable use of termcap
  120.     routines (relying on the ANSI_DEFAULT feature) will make your job a bit
  121.     easier.  However, you can compile with both TERMLIB and ANSI_DEFAULT
  122.     and simply not set your TERM variable if you do not wish to use the
  123.     termcap file settings.
  124.  
  125. 7.  If you want to change the high score list behavior, examine the top of
  126.     topten.c, in the src directory.  You may want to change the definitions of
  127.     PERSMAX, POINTSMIN, and ENTRYMAX.  I set POINTSMIN to 51 and ENTRYMAX to
  128.     50 to keep the size of the score list down.
  129.  
  130. 8.  Go to the src directory and edit the top of your Makefile.  Be sure the
  131.     directory you want the game installed (GAMEDIR) in actually exists.
  132.  
  133.     If you elected not to use the high-quality BSD random number routines by
  134.     commenting out RANDOM in pcconf.h or tosconf.h, comment out (or set equal
  135.     to nothing) the RANDOM macro in your Makefile.
  136.  
  137.     If you are recompiling after patching your sources, or if you got your
  138.     files from somewhere other than the official distribution, "touch
  139.     makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
  140.     lest potentially troublesome timestamps fool "make".
  141.  
  142. 9.  Now that everything is set up, go to the util directory and
  143.     run ndmake.  If you get any errors along the way then something
  144.     has not been set correctly.  Next do the same in the dat directory.
  145.     Finally, go to the src directory and "make install".  Depending on
  146.     your particular machine and compiler, you can either grab a cup
  147.     of coffee or go home for the day.  Your computer will be occupied
  148.     for a long time.  If all goes well, you will get an NetHack executable.
  149.  
  150. 10. Make sure the support files -- data, rumors, cmdhelp, opthelp, help, hh,
  151.     history, and license -- were copied to the game directory.  If not,
  152.     move them there from the dat directory yourself.  rumors. can be
  153.     created manually be entering "makedefs -r", data. by entering
  154.     "makedefs -d".
  155.  
  156.     Make sure the files NetHack.cnf and termcap also made it to your game
  157.     directory.  If not, go to sys\share and copy NetHack.cnf and
  158.     termcap to your game directory.  Edit NetHack.cnf to reflect your
  159.     particular setup and personal preferences, by following the comments.
  160.  
  161.     If you'll be running NetHack from a different subdirectory, you will
  162.     want to "set HACKDIR=c:\games\nethack" (or whatever drive and directory 
  163.     you want to use) now.  Add it to your autoexec.bat (in DOS), as you'll
  164.     be playing often.
  165.  
  166. 11. Play NetHack.  If it works, you're done!
  167.  
  168.  
  169. Appendix A - Microsoft C Compilers
  170.  
  171.     You can compile NetHack using almost any version of Microsoft C later
  172.     than 5.1.  Versions 5.0 and earlier are broken in such a way that it
  173.     is impossible to use them.  Version 6.0 requires a patch available
  174.     from Microsoft; after applying you should have 6.0ax.  Version 7.0
  175.     works with or without the August 1992 patch.
  176.  
  177.     Officially, support is no longer provided for MSC versions prior to
  178.     6.0ax.  NetHack v3.1 will compile with 5.1, but you will need to
  179.     make a lot of modifications to the makefiles in order to avoid heap
  180.     space problems.  We strongly recommend upgrading to 6.0ax if you
  181.     intend to recompile NetHack often.
  182.  
  183.     One Makefile is used for all versions.  Version 7.0 takes advantage
  184.     of the CL environment variables to set the compiler flags, as they
  185.     exceed the MSDOS limitation of 128 characters on the command line.
  186.     Please read the Makefile carefully and select those options that
  187.     go with the compiler.  Also, remember to run setup.bat to set the
  188.     CL environment variable before you compile.
  189.  
  190.     We use the following Makefiles:
  191.     MakeMSC.src  - src directory
  192.     MakeMSC.utl  - util directory
  193.     Makefile.dat - dat directory
  194.  
  195.     The Makefile uses a structured break-up of the object modules so that
  196.     we can link heavily used functions together without actual source code
  197.     movement.  This has provided a great speed improvement for this release.
  198.     See the file sys\msdos\ovlmgr.doc for more information on this
  199.     structuring.
  200.  
  201.   Microsoft C version 6.0:
  202.     The NetHack executable that you are about to get will be generated by an
  203.     overlay linker.  The beauty of this overlay linker beastie is that it will
  204.     create an executable that will function in much less memory than it would
  205.     "normally" take to run.  Do not be deceived.  The RAM requirement for the
  206.     overlay version is about 550k!  You can load the program in less RAM, but
  207.     you will begin to experience a serious amount of disk thrashing at 530k
  208.     or less.  Absolute minimum will probably be in the neighborhood of 380-400k.
  209.     You do not want to run the program like that!  The more free RAM you have
  210.     available for the program, the more smoothly it will run.
  211.  
  212.     Microsoft's internal overlay management scheme was pretty useless prior
  213.     to version 7.0.  However, the sheer size of NetHack requires some sort
  214.     of overlay scheme.  The magic piece to this puzzle is a program called
  215.     ovlmgr.asm.  This is a replacement for the Microsoft (and we use the
  216.     term loosely) overlay manager.  This program has been enhanced since
  217.     its release in November 1989.  It will now allow NetHack to use EMS
  218.     memory if any is available.  Also, the overlay manager will now read
  219.     overlays out of files completely separate from the EXE.  This will
  220.     cut down on the size of files for NetHack making distribution to PCs
  221.     with low density disk drives much easier.
  222.  
  223.     If you have a MASM compatible Assembler, you may want to enable the option
  224.     in the makefile to rebuild ovlmgr.obj, although a ready-made object file 
  225.     is provided for those of you without.  Before assembling ovlmgr, be sure
  226.     to read ovlmgr.doc as there are several options that you may or may not
  227.     wish to enable/disable.
  228.  
  229.   Microsoft C version 7.0
  230.     Microsoft was finally able to come out with a workable overlay
  231.     linker in version 7.0.  Instead of linking in the custom overlay
  232.     manager, we just let Microsoft do the work.
  233.  
  234. Appendix B - DJGPP Compiler (gcc ported to msdos)
  235.  
  236.     If you have a 386 or better machine, you are in luck.  You can compile
  237.     NetHack without spending money on a compiler.  DJGPP is available free
  238.     from many archive sites.
  239.  
  240.     Setting up DJGPP is more than adequately explained in the documentation
  241.     that comes with it.  Be sure to pick up the yacc and flex built with
  242.     DJGPP if you intend to do any modification of the special levels or
  243.     dungeon compilers.  They should be available at the same place you got
  244.     djgpp.
  245.  
  246.     The executable version of NetHack built with DJGPP runs in protected mode
  247.     without overlays and is quite fast.  It cannot run under Microsoft
  248.     Windows.  See the DJGPP documentation for more details on particular
  249.     memory requirements.
  250.  
  251.     Building with DJGPP is easy, just follow the steps outlined in the
  252.     main section.
  253.  
  254. Appendix C - Borland C Compiler
  255.  
  256.     NetHack will not compile at all with any version of Turbo C/C++.  It
  257.     has been made to compile with Borland C v2.0 after much work, but the
  258.     resulting binaries are far too slow to be playable.  It will not compile
  259.     with Borland C/C++ v3.0 - the bugs in that version of the compiler
  260.     related to the preprocessor make a total mess out of the macros that
  261.     the NetHack code is laced with.  We haven't had much luck at
  262.     compiling with v3.1 either.  If you successfully compile a playable
  263.     binary using any version of Borland's compiler we would love to
  264.     hear from you -- it would be a sure ticket to a position on the PC
  265.     Development team and all the fame and fortune that goes along with
  266.     it.  To get you started, here are a few hints.
  267.  
  268.     0. This should almost go without saying, but if you just bought
  269.        Borland (or Turbo C) and you are thinking that compiling
  270.        NetHack would be a great way to learn C and your nifty new
  271.        compiler at the same time, you are either going to prove
  272.        yourself some kind of prodigy or get very frustrated and quit.
  273.  
  274.     1. We left most of the __TURBOC__ defines in the code, some are
  275.        necessary, others are not, and a few are misleading depending
  276.        upon which compiler version you use as they relate to problems
  277.        with Borland compilers long since fixed.  We left them in to
  278.        provide some landmarks for future Borland hackers.
  279.  
  280.     2. No makefiles are provided as nothing we have tried has really
  281.        worked.  Most of our attempts have started off using the
  282.        GCC makefiles.
  283.  
  284.     3. Start off by working with the utility programs in the util
  285.        directory.  They are the smallest and will give you some
  286.        measure of success before you tackle the main code.  The
  287.        programs contained in util are necessary to build the
  288.        game so you will not be wasting your time.  Once you get
  289.        the utility program compiled, run the makefile in the dat
  290.        directory.  The utility programs you just compiled will attempt
  291.        to convert the raw data files into game readable form.  If you
  292.        get errors then something is wrong.
  293.  
  294. Appendix D - Microsoft C Compiler Warnings
  295.  
  296.     If you are using MSC for your compile with any of the /W levels set,
  297.     you can expect warnings.  The list below are those warnings that we
  298.     are aware of and our recommendation for dealing with them.  You can
  299.     use the warning disable pragma to ignore them if you wish.  (NOTE:
  300.     this is not a complete list of all warnings you might receive, only
  301.     those for which we feel we can safely provide guidance on.)
  302.  
  303. C4131 (function:uses old-style declarator)
  304.     You should ignore this warning.  In order to make the source code as
  305.     portable as possible, only old-style declarators are used so that as
  306.     many compilers as possible can use the same code.
  307. C4706 (Assignment within conditional expression)
  308.     This is a perfectly valid construction.  These warnings have not
  309.     produced any problems.
  310. C4761 (Integral size mismatch in argument; conversion supplied)
  311.     These should be no problem.  Prototyping compilers will do the con-
  312.     version, and non-prototyping compilers will go through int anyway.
  313.  
  314.  
  315. Notes:
  316.  
  317. 1)  Save files and bones files from previous versions of NetHack will not
  318.     work with this NetHack.  Don't bother trying to keep them.  Record
  319.     (score) files from before 3.0 patchlevel 7 will almost work, but you need
  320.     to make one change manually to them:  At the end of each line is a word or
  321.     phrase specifying what killed the player.  Change the string to start with
  322.     the words "killed by", "killed by a", or "killed by an" (whichever is
  323.     appropriate).  If the death was petrification, it should read "petrified
  324.     by" instead of "killed by".  Don't change "starvation", "quit", "escaped",
  325.     or "ascended".
  326.  
  327. 2)  To install an update of NetHack after changing something, enter "make45l"
  328.     from the src directory.  If you add, delete, or reorder monsters or
  329.     objects, or you change the format of saved level files, delete any save
  330.     and bones files.  (Trying to use such files sometimes produces amusing
  331.     confusions on the game's part, but usually crashes.)
  332.  
  333.     If you made changes to any of the level compiler software, you may have
  334.     to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c from the
  335.     util directory to ensure that they are remade.
  336.  
  337. 3)  During linking the Microsoft Overlay Linker will need temporary storage
  338.     space.  Make sure you have about a meg of free disk wherever you have
  339.     defined your temporary storage.
  340.  
  341. 4)  If you have comments or suggestions, feel free to drop any one of
  342.     us a line c/o nethack-bugs@linc.cis.upenn.edu.  From compuserve,
  343.     try INTERNET:nethack-bugs@linc.cis.upenn.edu.  Should you be
  344.     without email access, some of us can still be reached by lesser means:
  345.  
  346.     For the west coast:
  347.       Kevin D Smolkowski
  348.       c/o OSLC
  349.       207 E 5th
  350.       Eugene, OR  97401
  351.  
  352.     Compuserve users can also reach Paul Winner by sending compuserve mail
  353.     to 73207,226.  The NetHack binaries and sources can be found in the
  354.     GAMERS forum.
  355.